<style>
  #mask{height: 100% !important;  background-color:#ccc;  opacity:0.5;  filter: alpha(opacity=50);  position:absolute;  left:0;  top:0;  z-index:1000;}
  #login_remove{  position:fixed;  width: 750px;  height: 450px;  z-index:1001;  background: white;  border-radius: 15px;overflow-y: scroll;  }
</style>
<div style="min-height:400px;">
    <div class="weui-cells__title">
        已删除列表
    </div>
  <div class="weui-cell weui-cell_access">
    <div class="weui-cell__bd"><small>编号</small></div>
    <div class="weui-cell__bd"><small>帖子标题</small></div>
    <div class="weui-cell__bd"><small>删除操作人员</small></div>
    <div class="weui-cell__bd"><small>操作</small></div>
  </div>
  <div class="weui-cells" id="forum_remove">

  </div>
  <div id="page-remove" style="text-align: center"></div>
</div>

<sss>
initPageData2()
function openNew1() {
    //获取页面的高度和宽度
    var sWidth=document.body.scrollWidth;
    var sHeight=document.body.scrollHeight;
    //获取页面的可视区域高度和宽度
    var wHeight=document.documentElement.clientHeight;
    var oMask=document.createElement("div");
    oMask.id="mask";
    oMask.style.height=sHeight+"px";
    oMask.style.width=sWidth+"px";
    document.body.appendChild(oMask);
    var oLogin=document.createElement("div");
    oLogin.id="login_remove";
    oLogin.innerHTML="<div class='loginCon'><div id='close' style='position: absolute; right: 0; top: 0;'><i class='weui-icon weui-icon-cancel weui-icon-original' style='font-size: 25px;'></i></div></div>";
    document.body.appendChild(oLogin);
    //获取登陆框的宽和高
    var dHeight=oLogin.offsetHeight;
    var dWidth=oLogin.offsetWidth;
    //设置登陆框的left和top
    oLogin.style.left=sWidth/2-dWidth/2+"px";
    oLogin.style.top=wHeight/2-dHeight/2+"px";
    //点击关闭按钮
    var oClose=document.getElementById("close");
    //点击登陆框以外的区域也可以关闭登陆框
    oClose.onclick=oMask.onclick=function(){
      document.body.removeChild(oLogin);
      document.body.removeChild(oMask);
    };
  }
function initPageData2 (pages) {
  $.ajax({
    url: 'http://api.hongyanche.com/forum_admin/delete_list',
    type: 'GET',
    data: {
      page: pages
  },
    xhrFields:{
              withCredentials:true
    },
    success: function (data) {
      if (data.state) {
        var datas = data.data.list;
        $('#forum_remove').html(' ');
        $('#page-remove').html(data.page)
        datas.forEach(function (item, index) {
          $('#forum_remove').append(`
              <div class="weui-cell weui-cell_access">
                <div class="weui-cell__bd"><small class="lu">${item.forum_id}</small></div>
                <div class="weui-cell__bd"><small>${item.title}</small></div>
                <div class="weui-cell__bd"><small>${item.user_name}</small></div>
                <div class="weui-cell__bd">
                  <a href="javascript:void(0)" data-id="${item.forum_id}" class="huifu weui-btn weui-btn_mini weui-btn_primary">恢复</a>
                  <a href="javascript:void(0)" data-id="${item.forum_id}" class="look_info weui-btn weui-btn_mini weui-btn_warn">查看</a>
                 </div>
              </div>
          `)
        })
      }
    }
  })
}
$('body').on('click', '.huifu', function () {
   let ID = $(this).attr('data-id');
   $.ajax({
        url: 'http://api.hongyanche.com/forum_admin/recovery',
        type: 'POST',
        cache: false,
        data: {forum_id:ID},
        xhrFields:{
          withCredentials:true
        },
        success: function (data) {
          if(data.state == 1){
              alert("恢复成功");
              $('#forum_remove').html(' ');
              initPageData2();
          }else{
              alert("恢复失败");
          }
        },
        error: function (err) {
        }
      })
   });
$('body').on('click', '.look_info', function () {
      let ID = $(this).attr('data-id');
      $.ajax({
        url: 'http://api.hongyanche.com/forum_admin/delete_info',
        type: 'POST',
        xhrFields:{
          withCredentials:true
        },
        data: {
          forum_id: ID,
        },
        success: function (data) {
          if(data.state == 1){
            openNew1();
            $("#login_remove").html(`
              <div class="title" style="background-color:cornflowerblue"><h2>${data.data.info.title}</h2></div>
              <div class="content" style="margin-bottom: 20px;">${data.data.info.content}</div>
            `)
          }
        }
      })
    })
  function ajax_page_remove(num, e) {
    initPageData2(num)
  }
</sss>
